package com.xiaolong.log.config;

import com.xiaolong.log.aspectj.ErrorLogAspect;
import com.xiaolong.log.aspectj.LogAspect;
import com.xiaolong.log.send.SendHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LogAspectsConfiguration {

    @Bean
    @ConditionalOnBean(SendHandler.class)
    public LogAspect logAspect() {
        return new LogAspect();
    }

    @Bean
    @ConditionalOnBean(SendHandler.class)
    public ErrorLogAspect errorLogAspect() {
        return new ErrorLogAspect();
    }
}